package com.yuanchu.store.dto;

import com.baomidou.mybatisplus.annotation.TableId;
import com.yuanchu.common.validator.ValidationGroups;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @version: 1.0
 * @Author: adan
 * @description:
 * @date: 2024-02-18 19:32
 */
@Data
public class EditCartParamsDto {
    /**
     * 主键ID
     */
    @TableId
    private Integer id;
    /**
     * 商品ID
     */
    @NotNull(groups = {ValidationGroups.Update.class}, message = "修改必须指定商品id")
    @NotNull(groups = {ValidationGroups.Insert.class}, message = "新增必须指定商品id")
    private Integer goodsId;
    /**
     * 商品sku唯一标识
     */
    @NotBlank(groups = {ValidationGroups.Update.class}, message = "修改必须指定商品skuId")
    @NotBlank(groups = {ValidationGroups.Insert.class}, message = "新增必须指定商品skuId")
    private String goodsSkuId;
    /**
     * 商品数量
     */
    @NotNull(groups = {ValidationGroups.Update.class}, message = "修改必须指定商品数量")
    @NotNull(groups = {ValidationGroups.Insert.class}, message = "新增必须指定商品数量")
    private Integer goodsNum;

    @NotEmpty(groups = {ValidationGroups.Delete.class}, message = "删除必须指定购物车id")
    List<Integer> cartIds;
}
